<?php

/**
 * MailingMailingGroup form base class.
 *
 * @package    form
 * @subpackage mailing_mailing_group
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseMailingMailingGroupForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_mailing_mailing_group' => new sfWidgetFormInputHidden(),
      'id_mailing'               => new sfWidgetFormDoctrineChoice(array('model' => 'Mailing', 'add_empty' => false)),
      'id_mailing_group'         => new sfWidgetFormDoctrineChoice(array('model' => 'MailingGroup', 'add_empty' => true)),
      'created_at'               => new sfWidgetFormDateTime(),
      'updated_at'               => new sfWidgetFormDateTime(),
      'deleted'                  => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id_mailing_mailing_group' => new sfValidatorDoctrineChoice(array('model' => 'MailingMailingGroup', 'column' => 'id_mailing_mailing_group', 'required' => false)),
      'id_mailing'               => new sfValidatorDoctrineChoice(array('model' => 'Mailing')),
      'id_mailing_group'         => new sfValidatorDoctrineChoice(array('model' => 'MailingGroup', 'required' => false)),
      'created_at'               => new sfValidatorDateTime(array('required' => false)),
      'updated_at'               => new sfValidatorDateTime(array('required' => false)),
      'deleted'                  => new sfValidatorBoolean(),
    ));

    $this->widgetSchema->setNameFormat('mailing_mailing_group[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'MailingMailingGroup';
  }

}
